<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
	function doSave() 
	{
		if($("#title").val() == '') {
			alert("제목을 입력해 주세요.");
			return false;
		}
		
		if($("#contents").val() == '') {
			alert("내용을 입력해 주세요.");
			return false;
		}
		
		if(confirm("저장하시겠습니까?")) {
			document.forms[0].submit();			
		}
		
		return false;
	}
</script>
</head>

<body>
<div class="content_top">
	<p class="path">
		<strong>공지사항</strong>
	</p>
</div>
<h4>서비스 별 공지사항이 보여지며, 등록, 수정 가능합니다.</h4>

<form:form modelAttribute="notice" action="/notice/write" method="post">
<div class="tbl_type3">
	<table cellspacing="0" border="1">
	<col width="120">
	<col>
	<tr>
		<th>노출여부</th>
		<td>
			<input type="radio" class="rdo" name="use" value="Y" checked="checked"><span>노출</span></input>  
			<input type="radio" class="rdo" name="use" value="N"><span>숨김</span></input>
		</td>
	</tr>
	<tr>
		<th>제목</th>
		<td colspan="3">
			<input id="title" name="title" type="text" class="input_txt" style="width: 100%">
		</td>
	</tr>
	<tr>
		<th>내용</th>
		<td colspan="3">
			<textarea id="contents" name="contents" class="input_txt" style="width: 100%; height: 300px;" rows="50" cols="10"></textarea>
		</td>
	</tr>
	</table>
</div>
<br>

<div class="div_right">
	<a href="/notice/notice" class="btn_big"><strong>목록보기</strong></a>
	<a href="javascript:;" class="btn_big" onclick="doSave();"><strong>등록하기</strong></a>
</div>
</form:form>
</body>
</html>